package com.lxy.file.util;


import com.alibaba.fastjson.*;

import java.util.Set;

/** 类型转换工具类
 * @author LiuXiaoYu
 * @date 2021/6/15- 22:34
 */
public class TypeConvertUtil<T>{

    public TypeConvertUtil(){

    }
    public T typeConvert(Object object){
        return JSON.parseObject(JSON.toJSONString(object), new TypeReference<T>(){});
    }

    public Set<T> typeConvertToArray(Object object){
        return JSONArray.parseObject(JSON.toJSONString(object),Set.class);
    }


}
